#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int  ct(int fd){
    int count=0;
    char c;
    while(read(fd,&c,1)!=0)
    {
       if(c == '\n')
        count++;
        
    }
    return count;
    }
void mh(int fd,int n)
{ 
    int count=0;
    char c;
    while (read(fd, &c, 1)!=0) {
            if (c=='\n')
            {
            count++;
            }
        if (count>=n-10) {
            putchar(c);

            }

    }

}
int main(int argc,char *argv[])
{
    
    
    int fd=0,ft=0;
    int count;
    fd=open(argv[1],O_RDONLY);
    count=ct(fd);
   close(fd);
    ft=open(argv[1],O_RDONLY);
    mh(fd,count);
     close(ft);
     return 0;
}

